/*
    Project:        Home Power Control
    File:           HPCApplication.h
    Author:         christian@karunamusic.at
    Date:           01.2015
    Description:    Baseclass for the clients and the server.
                    Handles the -l, -c, -v, -h commandline arguments.
 */

#ifndef HPCAPPLICATION_H
#define HPCAPPLICATION_H

#include <QCoreApplication>
#include <QStringList>
#include "Logger/HPCLogger.h"
#include "Logger/HPCLogFile.h"
#include "Logger/HPCLogScreen.h"

class HPCApplication : public QCoreApplication
{
    Q_OBJECT
public:
    HPCApplication( int& argc, char** argv, const QString& appName );
    virtual ~HPCApplication();

    virtual void Run();

signals:

public slots:
    virtual void command( QString cmd );

protected:
    virtual void readConfig();

    virtual void cliHelp( QString topic = "" );
    virtual void cliLogLevel( QStringList& argv );

    TLogLevel m_LogLevels[3]; /**< loglevels for screen, file and database. */
    HPCLogScreen *m_LogScreen; /**< Log to screen. */
    HPCLogFile   *m_LogFile; /**< Log to file. */
    QString m_ConfigFile;
    bool m_Run;

private:
};

#endif // HPCAPPLICATION_H
